apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "5"
    description: {APP_NAME}
  generation: 5
  labels:
    k8s-app: {APP_NAME}
    qcloud-app: {APP_NAME}
    jenkins-job: {JOB_ANME}
    jenkins-build-id: "{BUILD_NUMBER}"
  name: {APP_NAME}
  namespace: {NAMESPACE}
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      k8s-app: {APP_NAME}
      qcloud-app: {APP_NAME}
      jenkins-job: {JOB_ANME}
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      annotations:
        eks.tke.cloud.tencent.com/root-cbs-size: "20"
        eks.tke.cloud.tencent.com/security-group-id: sg-00pu6lkj
      creationTimestamp: null
      labels:
        k8s-app: {APP_NAME}
        qcloud-app: {APP_NAME}
        jenkins-job: {JOB_ANME}
        jenkins-build-id: "{BUILD_NUMBER}"
    spec:
      affinity: {}
      containers:
      - env:
        - name: TZ
          value: Asia/Shanghai
        image: {IMAGE_URL}:{IMAGE_TAG}
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          initialDelaySeconds: 300
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: {APP_PORT}
          timeoutSeconds: 1
        name: {APP_NAME}
        readinessProbe:
          failureThreshold: 3
          initialDelaySeconds: 100
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: {APP_PORT}
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 500m
            memory: 1024Mi
          requests:
            cpu: 250m
            memory: 256Mi
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - name: qcloudregistrykey
      restartPolicy: Always
